﻿using System;
using System.ComponentModel;
using System.Data.Linq.Mapping;

namespace Data.MappingClasses
{
    [TableAttribute(Name = "dbo.TaskStatus")]
    public partial class TaskStatus : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private short _idTaskStatus;

        private string _nameTaskStatus;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnidTaskStatusChanging(short value);
        partial void OnidTaskStatusChanged();
        partial void OnnameTaskStatusChanging(string value);
        partial void OnnameTaskStatusChanged();
        #endregion

        public TaskStatus()
        {
            OnCreated();
        }

        [ColumnAttribute(Storage = "_idTaskStatus", AutoSync = AutoSync.OnInsert, DbType = "SmallInt NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public short idTaskStatus
        {
            get
            {
                return this._idTaskStatus;
            }
            set
            {
                if ((this._idTaskStatus != value))
                {
                    this.OnidTaskStatusChanging(value);
                    this.SendPropertyChanging();
                    this._idTaskStatus = value;
                    this.SendPropertyChanged("idTaskStatus");
                    this.OnidTaskStatusChanged();
                }
            }
        }

        [ColumnAttribute(Storage = "_nameTaskStatus", DbType = "VarChar(75) NOT NULL", CanBeNull = false)]
        public string nameTaskStatus
        {
            get
            {
                return this._nameTaskStatus;
            }
            set
            {
                if ((this._nameTaskStatus != value))
                {
                    this.OnnameTaskStatusChanging(value);
                    this.SendPropertyChanging();
                    this._nameTaskStatus = value;
                    this.SendPropertyChanged("nameTaskStatus");
                    this.OnnameTaskStatusChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}